<?php
class PapiWS_Model_ProductTemplateVO
{
	public $id;
	public $name;
	public $description;
	public $thumbnail;
	public $image;
	public $faces = array();
	public $facesPerPage = 1;
	
	public function __construct( $data = null )
	{
		$drupal = Zend_Registry::get('config')->drupal->url;
		$this->id = $data['nid'];
		$this->name = $data['title'];
		$this->description = $data['body'];
		if ( isset( $data['img'] ) ) {
			$this->thumbnail = $drupal . $data['img']['images']['thumbnail'];
			$this->image = $drupal . $data['img']['images']['preview'];
		}

		if ( isset( $data['field_faces_per_page'][0]['value'] ) ) {
			$this->facesPerPage =  $data['field_faces_per_page'][0]['value'];
		}
	}
}
